package com.qf.lanzhou.shop.admin.controller;

import com.qf.lanzhou.shop.admin.service.FeedbackShowService;
import com.qf.lanzhou.shop.pojo.entity.Feedback;
import com.qf.lanzhou.shop.pojo.entity.Seller;
import com.qf.lanzhou.shop.pojo.vo.BaseRespVO;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import javax.servlet.http.HttpServletRequest;
import java.util.List;

/**
 * @Author jian    反馈表信息展示
 * @Date 2021/1/11 15:19
 * @JDK 1.8
 * @Version 1.0
 */
@Api(tags = "反馈信息")
@Controller
public class FeedbackShowController extends BaseController{

    @Autowired
    private FeedbackShowService feedbackShowService;


    @ApiOperation(value = "卖家展示信息接口")
    @PostMapping(value = "/sellectmessage")
    @ResponseBody
    public BaseRespVO selectmessage(String message){
        System.out.println(message);
        System.out.println("hhhh");
        List<Feedback> list=feedbackShowService.selectmessage(message);
        return convertSuccessResult(list);
    }

    @ApiOperation(value = "展示卖家所有信息接口")
    @GetMapping(value = "/selectAll")
    @ResponseBody
    public BaseRespVO selectmessageAll(HttpServletRequest req){
        System.out.println("hhhh");
        Seller seller = (Seller) req.getSession().getAttribute("seller");
        String shopName = seller.getShopName();
        List<Feedback> list=feedbackShowService.selectmessageAll(shopName);
        System.out.println(list);
       return convertSuccessResult(list);

    }


}
